<template>
  <div class="login-phone">
    <el-form label-width="80px" :rules="rules" :model="loginData">
      <el-form-item label="手机号：" prop="phone">
        <el-input type="text" v-model="loginData.phone" />
      </el-form-item>
      <el-form-item label="验证码：" prop="code">
        <div class="code-box">
          <el-input type="text" v-model="loginData.code" />
          <el-button class="button" type="primary">获取验证码</el-button>
        </div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue";
import { rules } from "../config/phone-config";

export default defineComponent({
  components: {},
  setup() {
    const loginData = reactive({
      phone: "",
      code: "",
    });

    return {
      loginData,
      rules,
    };
  },
});
</script>

<style scoped lang="less">
.login-phone {
  width: 100%;
  height: 100%;
  .code-box {
    display: flex;
    .button {
      margin-left: 8px;
    }
  }
}
</style>
